from packages.common.base_model import db, BaseModel


class Schema(BaseModel):
    """
    数据模型模型
    """
    __tablename__ = "dev_schema"
    __table_args__ = ({"comment": "数据模型", "extend_existing": True})
    schemaGroupId = db.Column(db.BigInteger, name="schema_group_id", unique=False, nullable=True, comment="所属分组")
    tableName = db.Column(db.String, name="table_name", unique=False, nullable=True, comment="表名称")
    remark = db.Column(db.String, name="remark", unique=False, nullable=True, comment="表注释")
    otherRemark = db.Column(db.String, name="other_remark", unique=False, nullable=True, comment="额外说明")
    tableType = db.Column(db.Integer, name="table_type", unique=False, nullable=True, comment="表类型")
    formType = db.Column(db.Integer, name="form_type", unique=False, nullable=True, comment="表单类型")
    isTree = db.Column(db.Integer, name="is_tree", unique=False, nullable=True, comment="是否树")
    sort = db.Column(db.BigInteger, name="sort", unique=False, nullable=True, comment="排序")
    icon = db.Column(db.String, name="icon", unique=False, nullable=True, comment="图标")
    searchFormKeys = db.Column(db.String, name="search_form_keys", unique=False, nullable=True, comment="搜索表单key，可用于排序")
    listKeys = db.Column(db.String, name="list_keys", unique=False, nullable=True, comment="列表key，可用于排序")
    variable = db.Column(db.String, name="variable", unique=False, nullable=True, comment="扩展属性JSON")
